package com.huanletao.spring.aop.aop01;

import org.aopalliance.aop.Advice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.PointcutAdvisor;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

public class CustomMethodMatcherPointcut extends StaticMethodMatcherPointcut {
    @Override
    public boolean matches(Method m, Class targetClass) {
        String name = m.getName();
        return name.contains("User");
//        System.out.println("m = " + m);

//        System.out.println("targetClass = " + targetClass);
//        return true;
    }


}
